<template>
	<view class="wrap">
		<view class="select display">
			<view :class="['select-item',Inv==1?'select-act':'']" @click="changeTab(1)">初审中</view>
			<view :class="['select-item',Inv==2?'select-act':'']" @click="changeTab(2)">终审中</view>
			<view :class="['select-item',Inv==3?'select-act':'']" @click="changeTab(3)">领养成功</view>
			<view :class="['select-item',Inv==4?'select-act':'']" @click="changeTab(4)">已取消</view>		<!--申请销单-->
			<view :class="['select-item',Inv==5?'select-act':'']" @click="changeTab(5)">被拒绝</view>
			<view :class="['select-item',Inv==6?'select-act':'']" @click="changeTab(6)">待送养</view>
			<view :class="['select-item',Inv==7?'select-act':'']" @click="changeTab(7)">已送养</view>
		</view>
		<view class="items" v-for="(item,index) in dataList" :key="index" @click="openView(item.uuid)">
			
			<view class="item-right">
				
				<view class="item-city" v-show="item.adoptSex==0">
					性别：男
				</view>
				<view class="item-city" v-show="item.adoptSex==1">
					性别：女
				</view>
				<view class="item-city">
					所在城市：{{item.adoptCity}}
				</view>
				<view class="item-city">
					目前宠物：{{item.adoptPet}}
				</view>
				<view class="item-city">
					诚意：{{item.adoptExperience}}
				</view>
				<view class="item-city">
					养宠物经验：{{item.adoptDescribe}}
				</view>
				<view class="item-city">
					电话:{{item.adoptPhone}}
				</view>
				<view class="item-num">
					<span>婚姻情况:{{item.adoptMarriage}}&nbsp;</span>|
					<span>住房情况:{{item.adoptHousing}}&nbsp;</span>|
					<span>职业:{{item.adoptCareer}}&nbsp;</span>|
					<span>月收入:{{item.adoptIncome}}&nbsp;</span>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import { adoptList } from "@/api/list.js"
export default {
	data() {
		return {
			Inv:1,
			from:{},
			bannerList:[],
			dataList:[],
			
			}
		},
		onLoad(option) {
			this.from.createBy = option.id
			this.from.adoptionStatus=this.Inv
			this.getList()
			
			// this.getAnnouncementDetails(option.uuid)
			// 公告详情
			// getDetails('/service/release/',option.uuid).then((res) => {
			// 	this.content=res.data.data
			// 	this.list1.push(this.content.imageUrl)
				
			// })
		},
		onShow() {
			// this.getList();
		},
		methods: {
			changeTab(inv){
				this.Inv=inv
				this.from.adoptionStatus=inv
				this.getList()
			},
			getList(){
				adoptList(this.from).then(result => {
					if (result.data.code == 200) {
						// this.carouselListUrl = [];
						this.dataList=result.data.rows
					} else {
						uni.showToast({
							title: data.msg,
							icon: 'none',
							duration: 2000
						});
					}
				})
			},
			
			change(e) {
				// e.detail.index
				
				console.log(e.detail.index)
				if(e.detail.index==0){
					uni.navigateTo({
						url: '/pages/index/xunchong?releaseType='+2
					})
				}
				if(e.detail.index==1){
					uni.navigateTo({
						url: '/pages/index/xunchong?releaseType='+1
					})
				}
				if(e.detail.index==2){
					uni.navigateTo({
						url: '/pages/index/huodong'
					})
				}
				if(e.detail.index==3){
					uni.navigateTo({
						url: '/pages/index/xunchong?releaseType='+3
					})
				}
			},
			openView(uuid) {
				uni.navigateTo({
					url: '/pages/lingyang/details?uuid='+uuid
				})
			}
		}
	}
</script>

<style lang="scss">
	.select{
		 margin-bottom: 17rpx;
	}
	.select-item {
			font-size: 28upx;
			flex: 1;
			font-weight: bold;
			text-align: center;
			color: #3D3D3D;
			height: 100upx;
			line-height: 100upx;
			display: flex;
			justify-content: center;
			align-items: center;
			
		}
	.select-act {
			position:relative;
			z-index: 1;
			font-size:28rpx;
			font-weight: bold;
			color: #B87B40;
		}
	.select-act:before {
			content: '';
			width: 80%;
			height: 5rpx;
			background:#B87B40;
			position: absolute;
			bottom: 5rpx;
			left: 50%;
			z-index: -1;	
			transform: translateX(-50%);
		}
	.head {
		margin: 20upx;
		height: 300upx;
		background: #f5f5f5;
	}

	.banner {
		width: 710upx;
		height: 300upx;
		border-radius: 20upx;
	}.warp {
		width: 750upx;
		height: 200upx;
	}
	
	.text {
		font-size: 30upx;
		font-weight: 300;
		margin-top: 5px;
	}
	.grid-item-box {
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
		height: 280upx;
	}
	.grid-item-icon {
		width: 90upx;
		height: 90upx;
	}
	.items {
		display: flex;
		// width: 710upx;
		// height: 130upx;
		background: #f8f8f8;
		margin: 20upx;
		padding: 10upx 0upx;
		border-radius: 20upx;
	}
	.items image {
		margin: 10upx 0upx 0upx 10upx;
		width: 160upx;
		height: 160upx;
		border-radius: 50%;
	}
	.item-right {
		margin-left: 20upx;
		line-height: 40upx;
		width: 500upx;
	}
	.item-name {
		font-size: 30upx;
		font-weight: 700;
	}
	.item-name span {
		width: 100upx;
		font-weight: 300;
		font-size: 26upx;
	}
	.item-city {
		font-size: 26upx;
		font-weight: 300;
		color: #909399;
	}
	.item-major {
		font-size: 26upx;
		font-weight: 300;
		color: #909399;
	}
	.item-num {
		font-size: 26upx;
		font-weight: 300;
		color: #909399;
	}
	.item-price {
		font-size: 26upx;
		display: flex;
		color: #409EFF;
		justify-content: space-between;
	}
</style>
